package com.lz.constant;

import java.sql.Connection;

public enum TransactionIsolationLevel {
    //包括JDBC支持的5个级别
    NONE(Connection.TRANSACTION_NONE,100),
    READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED, 000),
    READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED, 000),
    REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ, 000),
    SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE, 120);

    private final int level;
    private final int x;

    /**
     * 必须要有构造方法
     * @param level
     * @param x
     */
     TransactionIsolationLevel(int level, int x) {
        this.level = level;
        this.x=x;
    }

    public int getLevel() {
        return level;
    }public int getX() {
        return x;
    }
}
class App{
    public static void main(String[] args) {
        TransactionIsolationLevel none = TransactionIsolationLevel.NONE;
        System.out.println(none);
        System.out.printf("%d,%d",none.getLevel(),none.getX());
    }
}
